package cn.main.entity.sys;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * Author: chengwei
 * Date:   2016/5/20
 * Time:   9:02
 */
@Entity
@Table(name = "sys_user")
public class User implements Serializable {
    private static final long serialVersionUID = -6997637143640442964L;
    
    @Id
    @Column(name = "user_id")
    private String userId;
    @Column
    private String name;
    @Column(name = "department_id")
    private String departmentId;
    @Column
    private String username;


    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        return !(getUserId() != null ? !getUserId().equals(user.getUserId()) : user.getUserId() != null);

    }

    @Override
    public int hashCode() {
        return getUserId() != null ? getUserId().hashCode() : 0;
    }
}
